load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "scheduledlogging",
    srcs = ["captured_index_usage_stats.go"],
    importpath = "github.com/cockroachdb/cockroach/pkg/sql/scheduledlogging",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/roachpb",
        "//pkg/security/username",
        "//pkg/settings",
        "//pkg/settings/cluster",
        "//pkg/sql/isql",
        "//pkg/sql/sem/tree",
        "//pkg/sql/sessiondata",
        "//pkg/util/log",
        "//pkg/util/log/eventpb",
        "//pkg/util/log/logpb",
        "//pkg/util/log/logutil",
        "//pkg/util/stop",
        "//pkg/util/timeutil",
        "@com_github_cockroachdb_errors//:errors",
    ],
)

go_test(
    name = "scheduledlogging_test",
    srcs = [
        "captured_index_usage_stats_test.go",
        "main_test.go",
    ],
    embed = [":scheduledlogging"],
    deps = [
        "//pkg/base",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/server",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/sqlutils",
        "//pkg/testutils/testcluster",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/log/logpb",
        "//pkg/util/log/logtestutils",
        "//pkg/util/randutil",
        "//pkg/util/syncutil",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_stretchr_testify//require",
    ],
)
